<div class="modal-resource-action">
  <!-- Use a form so that the enter key submits when typing a project name to confirm. -->
  <form>
    <div class="modal-body">
      <h1>Are you sure you want to delete the {{typeDisplayName || (kind | humanizeKind)}}
        '<strong>{{displayName ? displayName : resourceName}}</strong>'?</h1>
      <div ng-if="kind === 'ReplicationController' && rcReplicas" class="alert alert-warning">
        <span class="pficon pficon-warning-triangle-o" aria-hidden="true"></span>
        <span class="sr-only">Warning:</span>
        <strong>{{resourceName}}</strong> has running pods.  Deleting the
        {{typeDisplayName || (kind | humanizeKind)}} will <strong>not</strong> delete the pods
        it controls. Consider scaling the {{typeDisplayName || (kind | humanizeKind)}} down to
        0 before continuing.
      </div>

      <p>This<span ng-if="isProject"> will <strong>delete all resources</strong> associated with
      the project {{displayName ? displayName : resourceName}} and</span> <strong>cannot be
      undone</strong>.  Make sure this is something you really want to do!</p>

      <div ng-show="typeNameToConfirm">
        <p>Type the name of the {{typeDisplayName || (kind | humanizeKind)}} to confirm.</p>
        <p>
          <label class="sr-only" for="resource-to-delete">{{typeDisplayName || (kind | humanizeKind)}} to delete</label>
          <input
              ng-model="confirmName"
              id="resource-to-delete"
              type="text"
              class="form-control input-lg"
              autocorrect="off"
              autocapitalize="off"
              spellcheck="false"
              autofocus>
        </p>
      </div>

      <div ng-switch="kind">
        <div ng-switch-when="DeploymentConfig">
          <strong>Note:</strong> None of the deployments created by this deployment config will be deleted.

          To delete the deployment config and all of its deployments, you can run the command
          <pre class="code prettyprint mar-top-md">oc delete dc {{resourceName}} -n {{projectName}}</pre>
          Learn more about the <a href="command-line">command line tools</a>.
        </div>

        <div ng-switch-when="BuildConfig">
          <strong>Note:</strong> None of the builds created by this build config will be deleted.

          To delete the build config and all of its builds, you can run the command
          <pre class="code prettyprint mar-top-md">oc delete bc {{resourceName}} -n {{projectName}}</pre>
          Learn more about the <a href="command-line">command line tools</a>.
        </div>
      </div>

      <!--
        If this is a deployment config or replication controller with associated HPAs, prompt to
        delete the HPAs as well.
      -->
      <div ng-if="hpaList.length > 0">
        <p>
          <span ng-if="hpaList.length === 1">
            This resource has an autoscaler associated with it.
            It is recommended you delete the autoscaler with the resource it scales.
          </span>
          <span ng-if="hpaList.length > 1">
            This resource has autoscalers associated with it.
            It is recommended you delete the autoscalers with the resource they scale.
          </span>
        </p>
        <label>
          <input type="checkbox" ng-model="options.deleteHPAs">
          Delete
          <span ng-if="hpaList.length === 1">
            Horizontal Pod Autoscaler '<strong>{{hpaList[0].metadata.name}}</strong>'
          </span>
          <span ng-if="hpaList.length > 1">
            {{hpaList.length}} associated Horizontal Pod Autoscalers
          </span>
        </label>
      </div>
    </div>
    <div class="modal-footer">
      <button ng-disabled="typeNameToConfirm && confirmName !== resourceName && confirmName !== displayName" class="btn btn-lg btn-danger" type="submit" ng-click="delete();">Delete</button>
      <button class="btn btn-lg btn-default" type="button" ng-click="cancel();">Cancel</button>
    </div>
  </form>
</div>
